package banco;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;

@SuppressWarnings("deprecation")
public class HibernateUtil {
	private static final SessionFactory sessionFactory;  
	   static {  
	 	    Configuration cfg= new AnnotationConfiguration();
			cfg.configure("/banco/hibernate.cfg.xml");
			sessionFactory= cfg.buildSessionFactory();
	   }  
	  
	   public static Session getSession() {  
	      return sessionFactory.openSession();
	   } 

}